In many signal processing applications, it is desirable to transmit and/or store a digitized signal such that the exact original signal may be recovered. It is also desirable to reduce the number of bits needed to represent the signal in order to maximize the amount of data than can be handled during the transmission and/or storage process. Lossless compression techniques may be used to achieve this goal. Many techniques exist for lossless compression including Huffman coding, run-length coding, and predictive coding. Each of these coding techniques may provide comparatively better compression for certain classes of signals. However, improvements in lossless compression of digital signals are desirable.
Further, in many cases, digital signals to be encoded and transmitted include one predominant sample value, with sparse excursions to a few other sample values. For example, background noise in digital audio signals will often have a few distinct sample values. Signals with this sample characteristic are often not conducive to efficient encoding by known encoding techniques, such as linear predictive coding. When data to be transmitted includes predominantly one sample value, with sparse excursions to a single additional sample value, a run-length coding technique may be used. However, if sparse excursions occur to more than one other value, the typical run-length coding techniques may not be efficient, since such techniques may be most effective in encoding digital signals having sequences of one predominant sample value with a single other sample value sparsely included.